
CC = arm-linux-gnueabihf-g++
CXX = arm-linux-gnueabihf-g++
INC = -I../wiringPi -I./
CFLAGS = -O2 -Wall $(INC) -std=c++11
CXXFLAGS = $(CFLAGS)
LDFLAGS = -L../wiringPi -static
LIBS = -lwiringPi -lpthread -lm

C_SRC = $(wildcard *.c)
CXX_SRC = $(wildcard *.cpp)
SRC = $(wildcard *.c *.cpp)

OBJ = $(C_SRC:.c=.o)
OBJ += $(CXX_SRC:.cpp=.o)

TARGET = opiserv_poya

all:$(TARGET)

$(TARGET): $(OBJ)
	$(CC) -o $@ $^ $(LDFLAGS) $(LIBS)
    
.PHONY:clean all

echo:
	@echo $(OBJ)

clean:
	rm $(OBJ) $(TARGET)
